package com.ruoyi.project.outpatient.controller;

import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.project.outpatient.mapper.NewVisitMapper;
import com.ruoyi.project.outpatient.service.NewVisitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/outpatient/newvisit")
public class NewVisitController {
    @Autowired
    private NewVisitService newVisitService;

    /**
     * 选择患者
     * @param status
     * @return
     */
    @GetMapping("/find")
    @PreAuthorize("@ss.hasPermi('outpatient:newvisit:list')")
    public AjaxResult list(@RequestParam(defaultValue = "1") String status){
        char c = status.charAt(0);
        return AjaxResult.success(this.newVisitService.selectByStatus(c));
    }

    @GetMapping("/modifyRegisterIsStatus")
    public void modifyRegisterIsStatus(Integer id,Character status){
        this.newVisitService.modifyIsStatus(id,status);
    }
}
